<template>
    <template v-if="icon">
        <el-icon :size="size as any" :style="style">
            <component :is="icon"></component>
        </el-icon>
        <span>{{ value }}</span>
    </template>
</template>

<script setup lang="ts">
//父传子
interface Props {
    value?: string;
    icon?: string | null;
    size?: string | number | null;
    style?: any;
}
withDefaults(defineProps<Props>(), {
    value: "",
    icon: null,
    size: null,
    style: {},
});
</script>

<style scoped lang="less"></style>
